/*
 * @Author: fjxcjm 3157329468@qq.com
 * @Date: 2025-03-11 18:51:01
 * @LastEditors: fjxcjm 3157329468@qq.com
 * @LastEditTime: 2025-03-11 21:23:38
 * @FilePath: \RuoYi-Vue-master\ruoyi-admin\src\main\java\com\ruoyi\seedlingSys\service\impl\ZhongmiaoServiceImpl.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package com.ruoyi.seedlingSys.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.seedlingSys.mapper.ZhongmiaoMapper;
import com.ruoyi.seedlingSys.domain.Zhongmiao;
import com.ruoyi.seedlingSys.domain.Patch;
import com.ruoyi.seedlingSys.mapper.PatchMapper;
import com.ruoyi.seedlingSys.service.IZhongmiaoService;

/**
 * 种苗繁育管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-11
 */
@Service
public class ZhongmiaoServiceImpl implements IZhongmiaoService {
    @Autowired
    private ZhongmiaoMapper zhongmiaoMapper;

    @Autowired
    private PatchMapper patchMapper;

    /**
     * 查询种苗繁育管理
     * 
     * @param zhongMiaoID 种苗繁育管理主键
     * @return 种苗繁育管理
     */
    @Override
    public Zhongmiao selectZhongmiaoByZhongMiaoID(Long zhongMiaoID) {
        return zhongmiaoMapper.selectZhongmiaoByZhongMiaoID(zhongMiaoID);
    }

    /**
     * 查询种苗繁育管理列表
     * 
     * @param zhongmiao 种苗繁育管理
     * @return 种苗繁育管理
     */
    @Override
    public List<Zhongmiao> selectZhongmiaoList(Zhongmiao zhongmiao) {
        return zhongmiaoMapper.selectZhongmiaoList(zhongmiao);
    }

    /**
     * 新增种苗繁育管理
     * 
     * @param zhongmiao 种苗繁育管理信息
     * @return 结果
     */
    @Override
    @Transactional
    public int insertZhongmiao(Zhongmiao zhongmiao) {
        zhongmiao.setCreateTime(DateUtils.getNowDate());
        return zhongmiaoMapper.insertZhongmiao(zhongmiao);
    }

    /**
     * 修改种苗繁育管理
     * 
     * @param zhongmiao 种苗繁育管理
     * @return 结果
     */
    @Override
    public int updateZhongmiao(Zhongmiao zhongmiao) {
        zhongmiao.setUpdateTime(DateUtils.getNowDate());
        return zhongmiaoMapper.updateZhongmiao(zhongmiao);
    }

    /**
     * 批量删除种苗繁育管理
     * 
     * @param zhongMiaoIDs 需要删除的种苗繁育管理主键
     * @return 结果
     */
    @Override
    public int deleteZhongmiaoByZhongMiaoIDs(Long[] zhongMiaoIDs) {
        return zhongmiaoMapper.deleteZhongmiaoByZhongMiaoIDs(zhongMiaoIDs);
    }

    /**
     * 删除种苗繁育管理信息
     * 
     * @param zhongMiaoID 种苗繁育管理主键
     * @return 结果
     */
    @Override
    public int deleteZhongmiaoByZhongMiaoID(Long zhongMiaoID) {
        return zhongmiaoMapper.deleteZhongmiaoByZhongMiaoID(zhongMiaoID);
    }
}
